PHP pre-defined interface: ArrayAccess; php pre-defined arrayaccess. PHP pre-defined interface ArrayAccess, php pre-defined arrayaccess recently went home for the Chinese New Year, and the blog has not been updated. I feel that I have learned a lot
PHP pre-defined interface-ArrayAccess, php pre-defined arrayaccess
I recently went home for the Chinese New Year, and my blog has not been updated. I feel that I have learned a lot and missed many learning opportunities, just like what I often say
The PHP arrayaccess interface is also called an array-style access interface that provides the ability to access an object like an array.
The interface summary is as follows:
arrayaccess { //Get an offset position value abstract public mixed
After PHP5, a series of predefined interfaces are added, collectively known as SPL, for these interfaces and implemented classes. These interfaces have a heavyweight interface arrayaccess, which is used to make your object accessible like an array.
Brief introduction
An interface that provides the ability to access an object like an array.
Interface Summary
ArrayAccess {/* 方法 */abstract public boolean offsetExists ( mixed $offset )abstract public mixed
ArrayAccess interface introduction. A series of new interfaces are added in PHP5. You can learn about their applications in the series of articles translated by HaoHappy. At the same time, these interfaces and some implemented classes are classified
The pre-defined PHP interface-ArrayAccess interface provides interfaces that can access objects just like an array.
Interface abstract
ArrayAccess {/* method */abstract public boolean offsetExists (mixed $ offset) abstract public mixed offsetGet
This time to bring you the PHP array access interface arrayaccess use in detail, the use of PHP array interface arrayaccess considerations, the following is the actual case, together to see.
This example describes the PHP array-style access
This article mainly introduces the PHP array-type Access interface arrayaccess usage, combined with the example form analysis of the array-type access interface arrayaccess concept, function, implementation and use of the method, the need for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.